package com.chongqing.shiro.mapper;

import com.chongqing.shiro.model.entity.Permission;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

public interface PermissionMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Permission record);

    int insertSelective(Permission record);

    Permission selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Permission record);

    int updateByPrimaryKey(Permission record);

    List<Permission> selectPermissions(Integer status);

    List<Permission> selectMenusByUserId(String userId);

    Set<String> findPermsByUserId(String userId);

    List<Permission> findByRoleId(String roleId);

    List<Permission> selectAllMenuName(Integer statusValid);

    Permission findByPermissionId(String permissionId);

    int updateByPermissionId(Permission permission);

    int selectSubPermsByPermissionId(String permissionId);

    int updateStatus(@Param("permissionId")String permissionId, @Param("status") Integer status);
}